home *** CD-ROM | disk | FTP | other *** search
Modula Implementation | 1997-04-23 | 1.5 KB | 41 lines | [TEXT/3PRM] |
- implementation module menuDef;
-
- // MenuDefinitions:
-
- import commonDef;
-
- :: MenuDef *s *io
- = PullDownMenu MenuId MenuTitle SelectState [MenuElement s io];
- :: MenuElement *s *io
- = MenuItem MenuItemId ItemTitle KeyShortcut SelectState (MenuFunction s io)
- | CheckMenuItem MenuItemId ItemTitle KeyShortcut SelectState MarkState (MenuFunction s io)
- | SubMenuItem MenuId ItemTitle SelectState [MenuElement s io]
- | MenuItemGroup MenuItemGroupId [MenuElement s io]
- | MenuRadioItems MenuItemId [RadioElement s io]
- | MenuSeparator;
- :: RadioElement *s *io
- = MenuRadioItem MenuItemId ItemTitle KeyShortcut SelectState (MenuFunction s io);
- :: MenuFunction *s *io
- :== s -> *(io -> (s, io));
- :: MenuId :== Int;
- :: MenuTitle :== String;
- :: MenuItemId :== Int;
- :: MenuItemGroupId :== Int;
- :: KeyShortcut = Key KeyCode | NoKey;
-
-
- MenuDef_MenuId :: !(MenuDef s io) -> MenuId;
- MenuDef_MenuId (PullDownMenu id _ _ _) = id;
-
- MenuDef_SelectState :: !(MenuDef s io) -> SelectState;
- MenuDef_SelectState (PullDownMenu _ _ able _) = able;
-
- MenuDef_SetAbility :: !(MenuDef s io) !SelectState -> MenuDef s io;
- MenuDef_SetAbility (PullDownMenu id name _ items) able` = PullDownMenu id name able` items;
-
- MenuDef_Elements :: !(MenuDef s io) -> [MenuElement s io];
- MenuDef_Elements (PullDownMenu _ _ _ items) = items;
-
- MenuDef_ReplaceElements :: !(MenuDef s io) ![MenuElement s io] -> MenuDef s io;
- MenuDef_ReplaceElements (PullDownMenu id name able _) items = PullDownMenu id name able items;
-